'use strict';
(function() {

    ngApp.controller("alertController", ["$scope", function($scope) {

        // $scope.type = "";
        // $scope.msg = "";
        $scope.types = [
            'alert-success',
            'alert-info',
            'alert-warning',
            'alert-danger'
        ];


        $scope.alerts = [
        	{type:"alert-success", msg:"登录成功！"}
        ];
        $scope.addAlert = function() {
            if ($scope.type === undefined || $scope.msg === undefined) {
                $scope.alerts.push({
                    type: 'alert-warning',
                    msg: '类型和内容不能为空.'
                });
            } else {
                $scope.alerts.push({
                    type: $scope.type,
                    msg: $scope.msg
                });
            }

        };
    }]);

})();
